﻿
using System.Web.Mvc;

namespace EasyLift.TMS.Web.Models
{

    public class DriverViewModel
    {
        public Driver Driver { get; set; }
        public SelectList MissionStatus { get; private set; }
        public SelectList HRStatus { get; private set; }

        public DriverViewModel(Driver driver)
        {
            Driver = driver;

            DriverMissionStatusRepository missionStatusRepository = new DriverMissionStatusRepository();
            var statsSet = missionStatusRepository.GetAllData();
            MissionStatus = new SelectList(statsSet, "DriverMissionStatusCode", "DriverMissionStatusDescription", Driver.DriverMissionStatusCode);

            DriverHRStatusRepository hrStatusRepository = new DriverHRStatusRepository();
            var hrstatsSet = hrStatusRepository.GetAllData();
            HRStatus = new SelectList(hrstatsSet, "DriverHRStatusCode", "DriverHRStatusDescription", Driver.DriverHRStatusCode);
        }
    }
}